function x=opt(p, n)
printf("opt.m\n");
p
m=length(p)
m=m/4
%n=length(data)
n

for i=1:n
	x(i)=0;
	%mm=0;	
	for j=1:m
		mm=4*(j-1);
		x(i)=x(i)+((p(1+mm)*i+p(2+mm))*i+p(3+mm))*i+p(4+mm);
	end
end
